using UnityEngine;
using System.Collections;

public class Portal : MonoBehaviour {

    private bool tookKey = false;
	private bool triggeredPortal = false;
    public int nextPhase = 0;

    public bool TookKey{ set { tookKey = value; } }
	
	public bool TriggeredPortal { get{ return triggeredPortal;} }

    void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.tag.Equals(Tags.player) && tookKey)
        {
			triggeredPortal = true;
            Application.LoadLevel(nextPhase);
        }
    }
	
	void Update()
	{transform.Rotate(0,0,5);}
}